package com.jackie.easyble.ui.adapter

import android.bluetooth.le.ScanResult
import android.content.Context
import android.view.ViewGroup
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.DataBindingHolder
import com.jackie.easyble.R
import com.jackie.easyble.databinding.AdapterSingleConnectDeviceRecyclerBinding

class SingleConnectDeviceRecyclerAdapter :
    BaseQuickAdapter<ScanResult, SingleConnectDeviceRecyclerAdapter.ViewHolder>() {

    class ViewHolder(resId: Int, parent: ViewGroup) :
        DataBindingHolder<AdapterSingleConnectDeviceRecyclerBinding>(resId, parent)

    override fun onBindViewHolder(
        holder: ViewHolder,
        position: Int,
        item: ScanResult?
    ) {
        holder.binding.item = item
    }

    override fun onCreateViewHolder(
        context: Context,
        parent: ViewGroup,
        viewType: Int
    ): ViewHolder {
        return ViewHolder(R.layout.adapter_single_connect_device_recycler, parent)
    }

}